home *** CD-ROM | disk | FTP | other *** search
/ Mission to McDonaldLand / Mission To McDonaldLand.iso / maexp.dxr / 00027_Script_Go to Movie < prev    next >
Text File  |  1998-10-22  |  3KB  |  85 lines

  1. -- Movie      Go to/Play
  2.  
  3.  
  4. -- Either 'goes to' a movie or 'plays' a movie.  Goto won't return and play returns when the
  5. -- movie runs into 'playdone' in a lingo handler.  Use the Play Done behavior in the called
  6. -- movie to create this action.
  7. -- 
  8. -- also functions through lingo by handling message 'initGotoMovie', 
  9. -- for example if this behavior was assigned to sprite 5, use
  10. -- sendsprite 5, #initGotoMovie
  11.  
  12. property  movieName, playMode, whichEvent
  13.  
  14. on initGotoMovie me
  15.   init me
  16. end
  17.  
  18. on mouseUp me
  19.   if whichEvent = #mouseup    then init me
  20. end
  21.  
  22. on prepareFrame me
  23.   if whichEvent = #prepareframe then init me
  24. end
  25.  
  26. on exitFrame me
  27.   if whichEvent = #exitframe  then init me
  28. end
  29.  
  30. on init me
  31.   set the movieName of me = get_filename( movieName )
  32.   case ( playMode ) of:
  33.     #"Go to":
  34.       go to movie movieName
  35.     #"Play and Return":
  36.       play movie movieName
  37.   end case
  38. end
  39.  
  40.  
  41.  
  42. ---
  43.  
  44. on get_filename f_name
  45.   -- don't force user to remember the extension
  46.   if NOT ( f_name contains ".dir" ) then
  47.     set f_name = f_name & ".dir"
  48.   end if
  49.   -- support relative pathnames
  50.   if (( f_name contains "/" ) OR ¼
  51.       ( f_name contains "\" )) then
  52.     if ( NOT f_name contains ":" ) then
  53.       set f_name = the pathname & f_name
  54.     end if
  55.   end if
  56.   return( f_name )
  57. end
  58.  
  59. on getPropertyDescriptionList
  60.   
  61.   set p_list = [ ¼
  62.      #movieName: [ #comment:   "Movie:", ¼
  63.                     #format:   #string, ¼
  64.                    #default:   "       " ], ¼
  65.       #playMode: [ #comment:   "Play Mode:", ¼
  66.                     #format:   #symbol, ¼
  67.                      #range: [ #"Go to", #"Play and Return" ], ¼
  68.                    #default:   #"Go to" ], ¼
  69.     #whichEvent: [ #comment:  "Initializing Event:", ¼
  70.                     #format:   #symbol, ¼
  71.                      #range: [ #MouseUp, #PrepareFrame, #ExitFrame, #InitGotoMovie ], ¼
  72.                    #default:   #MouseUp ] ¼
  73.                  ]
  74.   return p_list  
  75. end
  76.  
  77. on getBehaviorDescription
  78.   return ¼
  79. "Plays a new Director movie in the same window." & RETURN & ¼
  80. "ò Movie - Enter the file name of a movie to play." & RETURN & ¼
  81. "ò Play Mode - Choose Play and Return to return to the current movie when the Playback Head reaches the end of the other movie or when the Play Done behavior is encountered. Choose Go To to play the other movie without returning to the current movie." & RETURN & ¼
  82. "ò Initializing Event - Specify the event that triggers the behavior."
  83. end
  84.  
  85.